/* eslint-disable */
import httpUtil from "@/utils/httpUtil";
import userApi from "./userApi";

const APP_ID = '2021003155631793'

const getAliUserIdMethod = (callBack) => {
	ap.getAuthCode({
		appId: APP_ID,
		scopes: ['auth_base'],

	}, (res) => {
		if (res.authCode) {
			let params = {
				code: res.authCode,
			}
			httpUtil.post('/api/rf/getAliUseridHjk', params, userRes => {
				userApi.setUserId(userRes.data.user_id)
				if (callBack) {
					callBack(userRes)
				}
			})
		} else {
			ap.alert(JSON.stringify(res));
		}
		// callBack(res);
	});
}

export default {
	getAliUserIdMethod,
}
